package com.marisfrolg.entity.json;

import java.util.List;

import com.lidroid.xutils.db.annotation.Column;
import com.lidroid.xutils.db.annotation.Table;
import com.marisfrolg.entity.EntityBase;
import com.marisfrolg.util.StringUtil;

@Table(name = "binstockup")
public class JsonBinStockUp extends EntityBase{
	@Column(column = "who")
	private String WHO; 
	
	private String IV_LGNUM;
	@Column(column = "des_bin")
	private String DES_BIN;
	
	private List<JsonBinStockItemUp> MAT_QUAN;


	public String getIV_LGNUM() {
		return IV_LGNUM;
	}

	public String getWHO() {
		return WHO;
	}


	public void setIV_LGNUM(String iV_LGNUM) {
		IV_LGNUM = iV_LGNUM;
	}

	public void setWHO(String WHO) {
		this.WHO = WHO;
	}
	
	public boolean  numFinish(){
		boolean finish=true;
		if(MAT_QUAN!=null&&MAT_QUAN.size()>0){
			for (JsonBinStockItemUp jb : MAT_QUAN) {
				finish=finish&&(!StringUtil.isEmpty(jb.getDESTIN_BIN()))&&(jb.QUAN-jb.UQUAN==0||jb.QUAN-jb.UQUAN==jb.QUAN);
			}
		}
		return finish;
	}
	
	public boolean notFinish(){
		boolean re=StringUtil.isEmpty(WHO)||StringUtil.isEmpty(IV_LGNUM)||MAT_QUAN==null;
		boolean finish=true;
		if(MAT_QUAN!=null&&MAT_QUAN.size()>0){
			for (JsonBinStockItemUp jb : MAT_QUAN) {
				finish=finish&&(!StringUtil.isEmpty(jb.getDESTIN_BIN()));//&&(jb.QUAN-jb.UQUAN==0||jb.QUAN-jb.UQUAN==jb.QUAN)
			}
		}
		return re||(!finish); 
	}

	/**
	 * @return the mAT_QUAN
	 */
	public List<JsonBinStockItemUp> getMAT_QUAN() {
		return MAT_QUAN;
	}

	/**
	 * @param mAT_QUAN the mAT_QUAN to set
	 */
	public void setMAT_QUAN(List<JsonBinStockItemUp> mAT_QUAN) {
		MAT_QUAN = mAT_QUAN;
	}

}
